using System;
using System.Collections.Generic;
using System.Text;

using libsecondlife;

using Feathertail;

namespace NestBox
{
    class RegionInfo : Feathertail.Command
    {
        FeathertailClient _Client;

        #region Command Members

        public void Setup(FeathertailClient Client)
        {
            _Client = Client;
        }

        public string HandleInput(string[] CmdLine)
        {
            if (CmdLine.Length < 2)
            {
                return GetHelpText();
            }

            string regionName = "";
            for (int i = 1; i < CmdLine.Length; i++)
            {
                regionName += CmdLine[i] + " ";
            }
            regionName = regionName.Trim();

            GridRegion gr;
            if (_Client.Grid.GetGridRegion(regionName, out gr))
            {
                return gr.ToString();
            }
            else
            {
                return "No Data Available for " + regionName;
            }
            
            
        }

        public string[] GetCommandStrings()
        {
            return new string[] { "REGIONINFO" };
        }

        public string GetSummaryText()
        {
            return "Display GridRegion info";
        }

        public string GetHelpText()
        {
            return "Usage: regioninfo [name]" + Environment.NewLine + "Example: regioninfo ahern";

        }

        #endregion
    }
}
